#include <stdio.h>
namespace NUM_OVERFLOW_DF {

	namespace bad_1 {
	
		void f()
		{
			unsigned short unA, unB;
			unsigned short unRet = 0;

			unA = 40000;
			unB = 30000;
			unRet = unA + unB;
		}
	
	}

	namespace bad_2 {
		void g()
		{
			signed int lX, lY;
			unsigned long long llZ = 0;
			lX = 2000000000;
			lY = 2000000000;
			llZ = (unsigned long long)(lX * lY);
		}

	}
	namespace good_1 {
		typedef unsigned long long uint64_t;
		typedef unsigned int uint32_t;
		uint64_t foo(uint32_t x, uint32_t y) {
			uint64_t z;
			z = (uint64_t)(x)*y;
			z = (uint64_t)(y) * 1000000U; //or: y*1000000ULL
			return z;
		}
	}
	namespace good_2 {
		void g()
		{
			signed int lX, lY;
			unsigned long long llZ = 0;
			lX = 2000000000;
			lY = 2000000000;
			llZ = (unsigned long long) (lX) * lY;
		}
	}
}